import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;

import java.awt.Rectangle;
import javax.swing.JButton;

public class trade7GUI extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JLabel jLabel = null;
	private int CardNum;
	private JButton jButton = null;
	private JButton jButton1 = null;
	private JButton jButton4 = null;
	private Players[] player;
	private Deeds[] deeds;
	private int playerchosen;
	private int playerturn;
	private JFrame frame;
	private JLabel jLabel1 = null;
	private int offer=0;
	private PropertyEvent property;
	/**
	 * This is the default constructor
	 */
	public trade7GUI(PropertyEvent property,int offer,int cardnum,int playerchosen,int playerturn,Players[] player,Deeds[] deeds,JFrame frame) {
		super();
		this.property=property;
		this.playerchosen=playerchosen;
		this.playerturn=playerturn;
		this.player=player;
		this.deeds=deeds;
		this.CardNum=cardnum;
		this.offer=offer;
		this.frame=frame;
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(498, 332);
		this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE) ;
		this.setContentPane(getJContentPane());
		this.setTitle("JFrame");
		this.setVisible(true);
		
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jLabel1 = new JLabel();
			jLabel1.setBounds(new Rectangle(224, 69, 254, 44));
			jLabel1.setText("Player 1 do you want to trade this for 1500?");
			jLabel = new JLabel();
			if(this.CardNum==1){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/MedAve.JPG")));
				}
				if(this.CardNum==2){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/BalticAve.jpg")));
				}
				if(this.CardNum==3){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/RR.JPG")));
				}
				if(this.CardNum==4){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Oriental.jpg")));
				}
				if(this.CardNum==5){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Vermont.jpg")));
				}
				if(this.CardNum==6){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Conn.jpg")));
				}
				if(this.CardNum==7){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Charlse.JPG")));
				}
				if(this.CardNum==8){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Electric.jpg")));
				}
				if(this.CardNum==9){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/StatesAve.jpg")));
				}
				if(this.CardNum==10){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Virginia.jpg")));
				}
				if(this.CardNum==11){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/PensRR.jpg")));
				}
				if(this.CardNum==12){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/James.jpg")));
				}
				if(this.CardNum==13){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Tennesee.jpg")));
				}
				if(this.CardNum==14){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/NewYork.jpg")));
				}
				if(this.CardNum==15){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Kentucky.jpg")));
				}
				if(this.CardNum==16){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Indiana.JPG")));
				}
				if(this.CardNum==17){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Illinois.jpg")));
				}
				if(this.CardNum==18){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/BO.jpg")));
				}
				if(this.CardNum==19){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Atlantic.jpg")));
				}
				if(this.CardNum==20){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Ventor.jpg")));
				}
				if(this.CardNum==21){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/WW.jpg")));
				}
				if(this.CardNum==22){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/MarvinGardens.JPG")));
				}
				if(this.CardNum==23){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Pacific.jpg")));
				}
				if(this.CardNum==24){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Nth.jpg")));
				}
				if(this.CardNum==25){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/Pens.jpg")));
				}
				if(this.CardNum==26){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/ShortLine.jpg")));
				}
				if(this.CardNum==27){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/ParkPlace.jpg")));
				}
				if(this.CardNum==28){
				jLabel.setIcon(new ImageIcon(getClass().getResource("/Images/BoardWalk.jpg")));
				}
			jLabel.setBounds(new Rectangle(40, 34, 175, 210));
			jLabel.setText("JLabel");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(jLabel, null);
			jContentPane.add(getJButton(), null);
			jContentPane.add(getJButton1(), null);
			jContentPane.add(jLabel1, null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new Rectangle(275, 168, 60, 46));
			jButton.setText("YES");
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					player[playerturn].setMoney(offer);
					player[playerchosen-1].setMoney(-offer);
					deeds[CardNum].setOwner(player[playerchosen-1].getName());
					frame.setEnabled(true);
					property.initialize(CardNum);
					setVisible(false);
				}
			});
		}
		return jButton;
	}

	/**
	 * This method initializes jButton1	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setBounds(new Rectangle(363, 169, 55, 44));
			jButton1.setText("NO");
			jButton1.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					frame.setEnabled(true);
					setVisible(false);
				}
			});
		}
		return jButton1;
	}

}
